import http from "@/api/axios";
// 运单工单 - 列表
export const getworkOrderPageDataApi = (data: WorkOrder.SearchFormParmas) => {
  return http({
    method: "post",
    url: "/base/biz/orderShipmentWorkOrder/pageData",
    data
  });
};

// 运单工单 - 分页状态标签统计
export const getworkOrderPageStatApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: "/base/biz/orderShipmentWorkOrder/pageStat",
    data
  });
};

//运单工单 - 查看详情
export const getDetailDataApi = (id: string) => {
  return http({
    method: "get",
    url: `/base/biz/orderShipmentWorkOrder/getDetailData/${id}`
  });
};

//运单工单-问题进度-更新进度
export const saveOrderPointApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: `/base/biz/orderShipmentWorkOrderPoint/saveOrderPoint`,
    data
  });
};

//运单工单-问题进度-处理完成
export const finishWorkOrderApi = (workOrderId: string) => {
  return http({
    method: "put",
    url: `/base/biz/orderShipmentWorkOrderPoint/finishWorkOrder/${workOrderId}`
  });
};

//运单工单-问题进度-删除进度
export const delOrderPointApi = (id: string) => {
  return http({
    method: "delete",
    url: `/base/biz/orderShipmentWorkOrderPoint/delOrderPoint/${id}`
  });
};

//运单工单-问题进度-编辑进度
export const updateOrderPointApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: `/base/biz/orderShipmentWorkOrderPoint/updateOrderPoint`,
    data
  });
};

//报海外仓运单报价-生成账单
export const createBillApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: `/base/biz/warehouseShipmentQuotation/createBill`,
    data
  });
};

//报海外仓运单报价-Lookup管理 - 根据父级code获取子级,适用于联动子级,即子级下还有子级
export const getLookupByCodeApi = (parentCode: string) => {
  return http({
    method: "get",
    url: `/base/biz/getLookupByCode/${parentCode}`
  });
};

//运单工单-修改问题类型(支持批量)
export const updateWorkOrderQuestionApi = (data: { idList: Array<string>; questionType: string }) => {
  return http({
    method: "post",
    url: `/base/biz/orderShipmentWorkOrder/updateWorkOrderQuestion`,
    data
  });
};

//导出工单excel
export const workOrderExcelApi = (data: WorkOrder.ExportType) => {
  return http({
    method: "post",
    url: `/export/biz/exportExcel/workOrderExcel`,
    data
  });
};
